package com.yjt.fresh.utils;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * 管理activity类
 * Created by GXCheng on 2016/4/8 9:03
 */
public class ActivityStackControlUtil {
    private static List<Activity> activityList = new ArrayList<Activity>();

    public static void remove(Activity activity) {

        activityList.remove(activity);

    }

    public static void add(Activity activity) {
        activityList.add(activity);

    }

    public static void finishProgram() {

        for (Activity activity : activityList) {
            activity.finish();

        }

        android.os.Process.killProcess(android.os.Process.myPid());

    }

}
